<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>二维地理信息服务平台</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <link rel="stylesheet" href="../../layui/css/layui.css" media="all">
    <link type="text/css" rel="stylesheet" href="../../CSS/common.css">
    <style>
        body {
            color: #fff;
            font-size: 13px;
        }

        .biote-title {
            height: 45px;
            line-height: 45px;
            background: rgba(42, 44, 64, .7);
            padding-left: 10px;
            font-size: 14px;
            font-weight: bold;
        }

        .biote-type {
            padding: 20px 20px;
        }

        .biote-type span {
            padding: 5px 10px;
            border-radius: 3px;
            border: 1px #fff solid;
        }

        .biote-kv {
            padding-bottom: 10px;
            margin-left: 20px;
        }

        .biote-type-value {
            margin-left: 50px;
        }

        .line {
            width: 95%;
            margin: 20px auto;
            height: 1px;
            background: #fff;
        }

        .biote-content {
            background: rgba(42, 44, 64, .9);
        }

        body::-webkit-scrollbar {
            /*滚动条整体样式*/
            width: 4px;
            /*高宽分别对应横竖滚动条的尺寸*/
            height: 4px;
            scrollbar-arrow-color: red;

        }

        body::-webkit-scrollbar-thumb {
            /*滚动条里面小方块*/
            border-radius: 5px;
            -webkit-box-shadow: inset 0 0 5px rgb(255, 255, 255);
            background: rgba(218, 218, 218, 0.2);
            scrollbar-arrow-color: red;
        }

        body::-webkit-scrollbar-track {
            /*滚动条里面轨道*/
            -webkit-box-shadow: inset 0 0 5px rgb(255, 255, 255);
            border-radius: 0;
            background: rgb(255, 255, 255);
        }

        .gk,
        .fx {
            width: 70px;
            height: 25px;
            line-height: 25px;
            border-radius: 15px;
            background: rgba(42, 44, 64, .1);
        }
    </style>

</head>

<body>
    <div class="layui-form">
        <div class="layui-tab">
            <ul class="layui-tab-title">
                <li class="layui-this" lay-id='info'>基本信息</li>
                <li lay-id='danger_source'>重大危险源</li>
                <li lay-id='crafts'>重点工艺</li>
                <li lay-id='danger_goods'>重点危化品</li>
                <li lay-id='danger_area'><img style="width: 40px;" src="../../static/IMG/tab.png"></li>
            </ul>
            <div class="layui-tab-content">
                <div class="layui-tab-item layui-show">
                    <div class="biote-title">临港化工 / 基本信息</div>
                    <div class="biote-content">
                        <div class="biote-type">
                            <span>62</span>
                            <span>危险化学品生产企业</span>
                            <span>生产</span>
                            <span>合成氨工业</span>
                            <span>300人</span>
                            <span>640.9亩</span>
                        </div>
                        <div class="biote-kv">
                            <span>企业名称</span>
                            <span class="biote-type-value">河北临港化工有限公司</span>
                        </div>
                        <div class="biote-kv">
                            <span>安全值班电话</span>
                            <span class="biote-type-value">0317-755-9873</span>
                        </div>
                        <div class="biote-kv">
                            <span>企业法人</span>
                            <span class="biote-type-value">胡印强</span>
                        </div>
                        <div class="biote-kv">
                            <span>成立时间</span>
                            <span class="biote-type-value">2005年2月</span>
                        </div>
                        <div class="biote-kv">
                            <span>企业地址</span>
                            <span class="biote-type-value">沧州渤海新区临港经济开发区西区生物医药园</span>
                        </div>
                        <div class="line"></div>
                        <div class="biote-kv">
                            <span>企业负责人</span>
                            <span class="biote-type-value">胡印强 186-3010-8190</span>
                        </div>
                        <div class="biote-kv">
                            <span>分管安全负责人</span>
                            <span class="biote-type-value">刘俊文 186-3010-8291</span>
                        </div>
                        <div class="biote-kv">
                            <span>安全部门负责人</span>
                            <span class="biote-type-value">周立杰 186-3010-8352</span>
                        </div>
                        <div class="line"></div>
                        <div class="biote-kv">
                            <span>危险品登记号</span>
                            <span class="biote-type-value">130912057</span>
                        </div>
                        <div class="biote-kv">
                            <span>重大危险源备案号</span>
                            <span class="biote-type-value">（沧） 安监重备字【2016】JWH0078</span>
                        </div>
                        <div class="biote-kv">
                            <span>应急预案备案号</span>
                            <span class="biote-type-value">130985-2019-0025</span>
                        </div>
                    </div>
                    <div class="biote-title">证件信息</div>
                    <div class="biote-content">
                        <div class="biote-type">
                            <span>62</span>
                            <span>危险化学品生产企业</span>
                            <span>生产</span>
                            <span>合成氨工业</span>
                            <span>300人</span>
                            <span>640.9亩</span>
                        </div>
                        <div class="biote-kv">
                            <span>企业名称</span>
                            <span class="biote-type-value">河北临港化工有限公司</span>
                        </div>
                        <div class="biote-kv">
                            <span>安全值班电话</span>
                            <span class="biote-type-value">0317-755-9873</span>
                        </div>
                        <div class="biote-kv">
                            <span>企业法人</span>
                            <span class="biote-type-value">胡印强</span>
                        </div>
                        <div class="biote-kv">
                            <span>成立时间</span>
                            <span class="biote-type-value">2005年2月</span>
                        </div>
                        <div class="biote-kv">
                            <span>企业地址</span>
                            <span class="biote-type-value">沧州渤海新区临港经济开发区西区生物医药园</span>
                        </div>
                        <div class="line"></div>
                        <div class="biote-kv">
                            <span>企业负责人</span>
                            <span class="biote-type-value">胡印强 186-3010-8190</span>
                        </div>
                        <div class="biote-kv">
                            <span>分管安全负责人</span>
                            <span class="biote-type-value">刘俊文 186-3010-8291</span>
                        </div>
                        <div class="biote-kv">
                            <span>安全部门负责人</span>
                            <span class="biote-type-value">周立杰 186-3010-8352</span>
                        </div>
                        <div class="line"></div>
                        <div class="biote-kv">
                            <span>危险品登记号</span>
                            <span class="biote-type-value">130912057</span>
                        </div>
                        <div class="biote-kv">
                            <span>重大危险源备案号</span>
                            <span class="biote-type-value">（沧） 安监重备字【2016】JWH0078</span>
                        </div>
                        <div class="biote-kv">
                            <span>应急预案备案号</span>
                            <span class="biote-type-value">130985-2019-0025</span>
                        </div>
                    </div>
                    <div class="biote-title">项目信息</div>
                    <div class="biote-content">
                        <div class="biote-type">
                            <span>62</span>
                            <span>危险化学品生产企业</span>
                            <span>生产</span>
                            <span>合成氨工业</span>
                            <span>300人</span>
                            <span>640.9亩</span>
                        </div>
                        <div class="biote-kv">
                            <span>企业名称</span>
                            <span class="biote-type-value">河北临港化工有限公司</span>
                        </div>
                        <div class="biote-kv">
                            <span>安全值班电话</span>
                            <span class="biote-type-value">0317-755-9873</span>
                        </div>
                        <div class="biote-kv">
                            <span>企业法人</span>
                            <span class="biote-type-value">胡印强</span>
                        </div>
                        <div class="biote-kv">
                            <span>成立时间</span>
                            <span class="biote-type-value">2005年2月</span>
                        </div>
                        <div class="biote-kv">
                            <span>企业地址</span>
                            <span class="biote-type-value">沧州渤海新区临港经济开发区西区生物医药园</span>
                        </div>
                        <div class="line"></div>
                        <div class="biote-kv">
                            <span>企业负责人</span>
                            <span class="biote-type-value">胡印强 186-3010-8190</span>
                        </div>
                        <div class="biote-kv">
                            <span>分管安全负责人</span>
                            <span class="biote-type-value">刘俊文 186-3010-8291</span>
                        </div>
                        <div class="biote-kv">
                            <span>安全部门负责人</span>
                            <span class="biote-type-value">周立杰 186-3010-8352</span>
                        </div>
                        <div class="line"></div>
                        <div class="biote-kv">
                            <span>危险品登记号</span>
                            <span class="biote-type-value">130912057</span>
                        </div>
                        <div class="biote-kv">
                            <span>重大危险源备案号</span>
                            <span class="biote-type-value">（沧） 安监重备字【2016】JWH0078</span>
                        </div>
                        <div class="biote-kv">
                            <span>应急预案备案号</span>
                            <span class="biote-type-value">130985-2019-0025</span>
                        </div>
                    </div>
                </div>
                <div class="layui-tab-item">
                    <div class="biote-title">临港化工 / 重大危险源</div>
                    <table id="zdwxy" lay-filter="zdwxy"></table>
                </div>
                <div class="layui-tab-item">
                    <div class="biote-title">临港化工 / 重点工艺</div>
                    <table id="zdgy" lay-filter="zdgy"></table>
                </div>
                <div class="layui-tab-item">
                    <div class="biote-title">临港化工 / 重点危化品</div>
                    <table id="zdwhp" lay-filter="zdwhp"></table>
                </div>
                <div class="layui-tab-item">
                    <div class="biote-title">临港化工 / 安全风险分区 / 全部分区</div>
                    <table id="aqfxfq" lay-filter="aqfxfq"></table>
                </div>
            </div>
        </div>
    </div>

    <script src="../../node_modules/jquery-2.0.3.js"></script>
    <script src="../../layui/layui.js" charset="utf-8"></script>
    <script>
        layui.use(['element', 'table'], function () {
            var element = layui.element,
                table = layui.table;
            parent.viewData.thisShowWindow = window;
            var viewData = parent.viewData;
            var ol = parent.ol;
            var pickData = viewData.pickData;

            table.render({
                elem: '#zdwxy'
                , height: 668
                // ,page: true //开启分页
                , cols: [[ //表头
                    { field: 'username', title: '危险源', width: 80 }
                    , { field: 'sex', title: '企业', width: 90 }
                    , { field: 'city', title: '级别', width: 60 }
                    , { field: 'sign', title: '涉及设施', width: 83 }
                    , { field: 'experience', title: '涉及危化品类', width: 97 }
                    , { field: 'score', title: '状态', width: 82 }
                ]],
                data: [{
                    "username": "HWO012"
                    , "score": "<span style='color: #ff5f3a'>报警</span>"
                    , "sex": "临港化工"
                    , "city": "一级"
                    , "sign": "3"
                    , "experience": "4"
                }, {
                    "username": "HWO013"
                    , "score": "正常"
                    , "sex": "临港化工"
                    , "city": "三级"
                    , "sign": "1"
                    , "experience": "1"
                }, {
                    "username": "HWO014"
                    , "score": "正常"
                    , "sex": "临港化工"
                    , "city": "四级"
                    , "sign": "1"
                    , "experience": "1"
                }, {
                    "username": "HWO015"
                    , "score": "正常"
                    , "sex": "临港化工"
                    , "city": "四级"
                    , "sign": "1"
                    , "experience": "1"
                }, {
                    "username": "HWO016"
                    , "score": "正常"
                    , "sex": "临港化工"
                    , "city": "三级"
                    , "sign": "1"
                    , "experience": "1"
                }, {
                    "username": "HWO017"
                    , "score": "正常"
                    , "sex": "临港化工"
                    , "city": "二级"
                    , "sign": "1"
                    , "experience": "1"
                }]
            });
            table.render({
                elem: '#zdgy'
                , height: 668
                // ,page: true //开启分页
                , cols: [[ //表头
                    { field: 'username', title: '企业', width: 120 }
                    , { field: 'sex', title: '生产场所', width: 120 }
                    , { field: 'city', title: '工艺名称', width: 130 }
                    , { field: 'sign', title: '投用时长', width: 125 }
                ]],
                data: [{
                    "username": "临港化工"
                    , "score": "<span style='color: #ff5f3a'>报警</span>"
                    , "sex": "1# 反应釜"
                    , "city": "氯化工艺"
                    , "sign": "359天"
                }, {
                    "username": "临港化工"
                    , "score": "正常"
                    , "sex": "2# 反应釜"
                    , "city": "氯化工艺"
                    , "sign": "1093天"
                }, {
                    "username": "临港化工"
                    , "score": "正常"
                    , "sex": "3# 反应釜"
                    , "city": "碘化工艺"
                    , "sign": "2049天"
                }, {
                    "username": "临港化工"
                    , "score": "正常"
                    , "sex": "5# 反应釜"
                    , "city": "光气及光气化"
                    , "sign": "2049天"
                }]
            });
            table.render({
                elem: '#zdwhp'
                , height: 668
                // ,page: true //开启分页
                , cols: [[ //表头
                    { field: 'username', title: '企业', width: 120 }
                    , { field: 'sex', title: '生产/储存场所', width: 120 }
                    , { field: 'city', title: '危化品', width: 130 }
                    , { field: 'sign', title: '危化品量', width: 125 }
                ]],
                data: [{
                    "username": "临港化工"
                    , "sex": "1-1#储罐"
                    , "city": "液氮"
                    , "sign": "30T"
                }, {
                    "username": "临港化工"
                    , "sex": "1-2#储罐"
                    , "city": "液氮"
                    , "sign": "30T"
                }, {
                    "username": "临港化工"
                    , "sex": "1-3#储罐"
                    , "city": "氢气"
                    , "sign": "50T"
                }]
            });
            table.render({
                elem: '#aqfxfq'
                , height: 668
                // ,page: true //开启分页
                , cols: [[ //表头
                    { field: 'username', title: '风险点名称', width: 100 }
                    , { field: 'sex', title: '风险点类别', width: 100 }
                    , { field: 'city', title: '评估方法', width: 80 }
                    , { field: 'sign', title: '管控等级', width: 104 }
                    , { field: 'experience', title: '风险等级', width: 110 }
                ]],
                data: [{
                    "username": "1#罐区"
                    , "sex": "作业活动"
                    , "city": "LS"
                    , "sign": "<button style='border: 1px #5b8dff solid;color:#5b8dff;' class='layui-btn layui-btn-sm gk'>岗位</button>"
                    , "experience": "<button style='border: 1px #5b8dff solid;color:#5b8dff;' class='layui-btn layui-btn-sm fx'>低风险</button>"
                }, {
                    "username": "2#罐区"
                    , "sex": "作业活动"
                    , "city": "LES"
                    , "sign": "<button style='border: 1px #fff852 solid;color:#fff852;' class='layui-btn layui-btn-sm gk'>班组</button>"
                    , "experience": "<button style='border: 1px #fff852 solid;color:#fff852;' class='layui-btn layui-btn-sm fx'>低风险</button>"
                }, {
                    "username": "3#罐区"
                    , "sex": "作业活动"
                    , "city": "直接判定"
                    , "sign": "<button style='border: 1px #ff6d07 solid;color:#ff6d07;' class='layui-btn layui-btn-sm gk'>公司 / 厂</button>"
                    , "experience": "<button style='border: 1px #ff6d07 solid;color:#ff6d07;' class='layui-btn layui-btn-sm fx'>重大风险</button>"
                }, {
                    "username": "汽油罐区"
                    , "sex": "作业活动"
                    , "city": "直接判定"
                    , "sign": "<button style='border: 1px #ff0000 solid;color:#ff0000;' class='layui-btn layui-btn-sm gk'>车间 / 部室</button>"
                    , "experience": "<button style='border: 1px #ff0000 solid;color:#ff0000;' class='layui-btn layui-btn-sm fx'>重大风险</button>"
                }]
            });

            window.thisTap = null;
            element.on('tab', function () {
                if ((pickData["TE_DESC"] || pickData["name"]) !== '河北临港化工有限公司') {
                    return;
                }
                recover();

                let layID = this.getAttribute('lay-id');
                thisTap = layID;

                let Coordinates = viewData.thisSelect.getGeometry().getInteriorPoints().getCoordinates();
                Coordinates = [Coordinates[0][0], Coordinates[0][1]];
                viewData.resultTooltip.showAt(pickData["TE_DESC"] || pickData["name"], Coordinates);

                switch (thisTap) {
                    case 'danger_source': parent.showDangerData(true); break;
                    case 'crafts': parent.showCraftsData(true); break;
                    case 'danger_goods': parent.showDangerGoodsData(true); break;
                    case 'danger_area': parent.showDangerAreaData(true); break;
                }
            });

            window.dangerData = null;
            window.craftsData = null;
            window.DangerGoodsData = null;
            window.DangerAreaData = null;
            var thisTr;
            $(".layui-table-body tr").hover(function () {
                if (thisTap === 'danger_source') {
                    let index = parseInt(this.dataset.index);
                    !viewData.danger.source && (viewData.danger.source = viewData.danger.getSource().getFeatures());
                    dangerData && viewData.selectHandler.removeSelectedStyle_(dangerData);
                    dangerData = viewData.danger.source[index];
                    viewData.selectHandler.giveSelectedStyle_(dangerData);
                    let data = dangerData.values_;
                    let Coordinates = dangerData.getGeometry().getInteriorPoints().getCoordinates();
                    Coordinates = [Coordinates[0][0], Coordinates[0][1]];
                    viewData.resultTooltip.showAt(data.name + '/' + data.qiye + '/' + data.level + '重大危险源', Coordinates);
                } else if (thisTap === 'crafts') {
                    let index = parseInt(this.dataset.index);
                    !viewData.crafts.source && (viewData.crafts.source = viewData.crafts.getSource().getFeatures());
                    craftsData && craftsData.setStyle(new ol.style.Style({
                        image: new ol.style.Icon({
                            src: '../static/IMG/point1.png',
                            scale: 0.5
                        })
                    }));

                    craftsData = viewData.crafts.source[index];
                    craftsData.setStyle(new ol.style.Style({
                        image: new ol.style.Icon({
                            src: '../static/IMG/point1.png',
                            scale: 0.8
                        })
                    }));

                    if (window.clickData && craftsData == clickData) {
                        viewData.resultTooltip.show(false);
                        return;
                    }

                    let data = craftsData.values_;
                    let Coordinates = craftsData.getGeometry().flatCoordinates;
                    Coordinates = [Coordinates[0], Coordinates[1]];
                    viewData.resultTooltip.showAt(data.qiye + '/' + data.name + '/' + data.gy, Coordinates);
                } else if (thisTap === 'danger_goods') {
                    let index = parseInt(this.dataset.index);
                    !viewData.DangerGoods.source && (viewData.DangerGoods.source = viewData.DangerGoods.getSource().getFeatures());
                    DangerGoodsData && DangerGoodsData.setStyle(new ol.style.Style({
                        image: new ol.style.Icon({
                            src: '../static/IMG/point.png',
                            scale: 0.5
                        })
                    }));

                    DangerGoodsData = viewData.DangerGoods.source[index];
                    DangerGoodsData.setStyle(new ol.style.Style({
                        image: new ol.style.Icon({
                            src: '../static/IMG/point.png',
                            scale: 0.8
                        })
                    }));

                    if (window.clickData && DangerGoodsData == clickData) {
                        viewData.resultTooltip.show(false);
                        return;
                    }

                    let data = DangerGoodsData.values_;
                    let Coordinates = DangerGoodsData.getGeometry().flatCoordinates;
                    Coordinates = [Coordinates[0], Coordinates[1]];
                    viewData.resultTooltip.showAt(data.qiye + '/' + data.name + '/' + data.whp + '/' + data.num, Coordinates);
                } else if (thisTap === 'danger_area') {
                    let index = parseInt(this.dataset.index);
                    !viewData.DangerArea.source && (viewData.DangerArea.source = viewData.DangerArea.getSource().getFeatures());
                    DangerAreaData && viewData.selectHandler.removeSelectedStyle_(DangerAreaData);
                    DangerAreaData = viewData.DangerArea.source[index];
                    viewData.selectHandler.giveSelectedStyle_(DangerAreaData);
                    let data = DangerAreaData.values_;
                    let Coordinates = DangerAreaData.getGeometry().getInteriorPoints().getCoordinates();
                    Coordinates = [Coordinates[0][0], Coordinates[0][1]];
                    viewData.resultTooltip.showAt(data.qiye + '/' + data.name, Coordinates);
                }
            });
            $(".layui-table-body tr").click(function () {
                if (thisTap === 'crafts') {
                    viewData.resultTooltip.show(false);
                    let data = craftsData.values_;
                    window.clickData = craftsData;
                    craftsData && parent.showChartData(craftsData, data.qiye + '/' + data.name + '/' + data.gy);
                } else if (thisTap === 'danger_goods') {
                    viewData.resultTooltip.show(false);
                    let data = DangerGoodsData.values_;
                    window.clickData = DangerGoodsData;
                    DangerGoodsData && parent.showChartData(DangerGoodsData, data.qiye + '/' + data.name + '/' + data.whp + '/' + data.num);
                }
            });

            window.recover = recover;
            function recover() {
                if (thisTap) {
                    switch (thisTap) {
                        case 'danger_source': parent.showDangerData(false); break;
                        case 'crafts': parent.showCraftsData(false); break;
                        case 'danger_goods': parent.showDangerGoodsData(false); break;
                        case 'danger_area': parent.showDangerAreaData(false); break;
                    }
                }
                viewData.selectHandler.getFeatures().clear();
                dangerData && viewData.selectHandler.removeSelectedStyle_(dangerData);
                craftsData && craftsData.setStyle(new ol.style.Style({
                    image: new ol.style.Icon({
                        src: '../static/IMG/point1.png',
                        scale: 0.5
                    })
                }));
                DangerGoodsData && DangerGoodsData.setStyle(new ol.style.Style({
                    image: new ol.style.Icon({
                        src: '../static/IMG/point.png',
                        scale: 0.5
                    })
                }));
                DangerAreaData && viewData.selectHandler.removeSelectedStyle_(DangerAreaData);
                parent.closeChartData();
            }
        });
    </script>
</body>

</html>